home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ImageMagick / magick / XWDFile.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.0 KB  |  87 lines

  1. /* Copyright 1985, 1986, Massachusetts Institute of Technology */
  2.  
  3. /* $XConsortium: XWDFile.h,v 1.12 89/10/08 16:33:57 rws Exp $ */
  4. /*
  5.  * XWDFile.h    MIT Project Athena, X Window system window raster
  6.  *        image dumper, dump file format header file.
  7.  *
  8.  *  Author:    Tony Della Fera, DEC
  9.  *        27-Jun-85
  10.  * 
  11.  * Modifier:    William F. Wyatt, SAO
  12.  *              18-Nov-86  - version 6 for saving/restoring color maps
  13.  */
  14.  
  15.  
  16. /*
  17.  * This is not portable between machines of differing word sizes.  To make
  18.  * it portable, do the following things:
  19.  *
  20.  *     o  #include <X11/Xmd.h>
  21.  *     o  remove the typedef for xwdval
  22.  *     o  replace all instances of xwdval with the appropriate CARD32 ... B32
  23.  *     o  make sure that XWDFileHeader is padded to quadword boundaries
  24.  *     o  make sure the window name is written out quadword aligned
  25.  *     o  create an XWDColor structure that contains the same fields as XColor
  26.  *        but which is defined in terms of CARD32 B32, CARD16 B16, and CARD8
  27.  *     o  convert XColor structures to XWDColor structures in xwd
  28.  *     o  remove all xwdval casts from xwd
  29.  *     o  pack image data before writing out if necessary
  30.  *     o  replace casts from xwdval objects in xwud with cvtINT macros
  31.  *     o  convert XWDColor structures to XColor structures
  32.  *     o  unpack data after reading in if necessary
  33.  */
  34.  
  35.  
  36. #include <X11/Xmd.h>
  37.  
  38. #define XWD_FILE_VERSION 7
  39. #ifdef WORD64
  40. #define sz_XWDheader 104
  41. #else
  42. #define sz_XWDheader 100
  43. #endif
  44. #define sz_XWDColor 12
  45.  
  46. typedef CARD32 xwdval;        /* for old broken programs */
  47.  
  48. typedef struct _xwd_file_header {
  49.     CARD32 header_size B32;  /* Size of the entire file header (bytes). */
  50.     CARD32 file_version B32;    /* XWD_FILE_VERSION */
  51.     CARD32 pixmap_format B32;    /* Pixmap format */
  52.     CARD32 pixmap_depth B32;    /* Pixmap depth */
  53.     CARD32 pixmap_width B32;    /* Pixmap width */
  54.     CARD32 pixmap_height B32;    /* Pixmap height */
  55.     CARD32 xoffset B32;        /* Bitmap x offset */
  56.     CARD32 byte_order B32;        /* MSBFirst, LSBFirst */
  57.     CARD32 bitmap_unit B32;        /* Bitmap unit */
  58.     CARD32 bitmap_bit_order B32;    /* MSBFirst, LSBFirst */
  59.     CARD32 bitmap_pad B32;        /* Bitmap scanline pad */
  60.     CARD32 bits_per_pixel B32;    /* Bits per pixel */
  61.     CARD32 bytes_per_line B32;    /* Bytes per scanline */
  62.     CARD32 visual_class B32;    /* Class of colormap */
  63.     CARD32 red_mask B32;        /* Z red mask */
  64.     CARD32 green_mask B32;        /* Z green mask */
  65.     CARD32 blue_mask B32;        /* Z blue mask */
  66.     CARD32 bits_per_rgb B32;    /* Log2 of distinct color values */
  67.     CARD32 colormap_entries B32;    /* Number of entries in colormap */
  68.     CARD32 ncolors B32;        /* Number of Color structures */
  69.     CARD32 window_width B32;    /* Window width */
  70.     CARD32 window_height B32;    /* Window height */
  71.     CARD32 window_x B32;        /* Window upper left X coordinate */
  72.     CARD32 window_y B32;        /* Window upper left Y coordinate */
  73.     CARD32 window_bdrwidth B32;    /* Window border width */
  74. #ifdef WORD64
  75.     CARD32 header_end B32;        /* Pad to fill out word */
  76. #endif
  77. } XWDFileHeader;
  78.  
  79. static struct {
  80.         CARD32    pixel B32;
  81.         CARD16    red B16;
  82.     CARD16    green B16;
  83.     CARD16    blue B16;
  84.         CARD8    flags;
  85.         CARD8    pad;
  86. } XWDColor;
  87.